import { request } from 'umi';

export async function fakeSubmitForm(params: any) {
  return request('/api/ucUser/save', {
    method: 'POST',
    data: params,
  });
}

export async function querySubscriberDetail(params: any) {
  return request('/api/ucUser/' + params.id, {
    method: 'get',
    data: params,
  });
}

export async function list(params: any) {
  return request('/api/ucUser/page', {
    method: 'POST',
    data: params,
  });
}

/** 修改文章 PUT /api/Subscriber */
export async function updateSubscriber(params: any) {
  return request('/api/ucUser/updateById', {
    method: 'PUT',
    data: params,
  });
}

/** 删除文章 DELETE /api/Subscriber */
export async function removeSubscriber(data: { key: number[] }, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/ucUser/' + data.key, {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}

export async function addUserVisitor(params: any) {
  return request('/api/userVisitor/save', {
    method: 'POST',
    data: params,
  });
}

export async function queryUserVisitorDetail(params: any) {
  return request('/api/userVisitor/' + params.id, {
    method: 'get',
    data: params,
  });
}

export async function queryUserVisitorList(params: any) {
  return request('/api/userVisitor/page', {
    method: 'POST',
    data: params,
  });
}

export async function updateUserVisitor(params: any) {
  return request('/api/userVisitor/updateById', {
    method: 'PUT',
    data: params,
  });
}
